package com.yuan.spring.spel;

import org.junit.Test;
import org.springframework.expression.Expression;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;

/**
 * spring SpEl 表达式
 * SpEl是可以独立运行的模块
 * Created by 袁恩光 on 2017/5/31.
 */
public class SpElTest {

    @Test
    public void test() {
        ExpressionParser expressionParser = new SpelExpressionParser();
        Expression expression = expressionParser.parseExpression("'helloWorld'.concat('!')");
        Object object = expression.getValue();
        //输出结果是 helloWorld!
        System.out.println(object.toString());
    }

}
